def append_(a,b):
    if a not in b:
        b.append(a)
with open('mary.txt') as mary:
    words=[]
    for line in mary:
        lst=list(line.split())
        for word in lst:
            if '.' in word:
                word=word.strip('.')
            elif ',' in word:
                word=word.strip(',')
            word=word.lower()
            append_(word,words)
    words.sort()
    print(words)
            
